<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2022/2/7
  Time: 20:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
    <base href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/"/>
    <script type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <script type="text/javascript">
        $(function () {

            $("#btn3").click(function () {
                var array = [5, 8, 12];

                var arrayStr = JSON.stringify(array);

                $.ajax({
                    "url": "send/array/plan/three.html",
                    "type": "post",
                    "data": arrayStr,
                    "contentType":"application/json;charset=UTF-8",
                    "dataType": "text",
                    "success": function (response) {
                        alert(response);
                    },
                    "error": function (response) {
                        alert(response);
                    }
                });
            });

<%--            $("#btn2").click(function () {--%>
<%--                $.ajax({--%>
<%--                    "url": "send/array/two.html",--%>
<%--                    "type": "post",--%>
<%--                    "data": {--%>
<%--                        "array[0]": 5,--%>
<%--                        "array[1]": 8,--%>
<%--                        "array[2]": 12--%>
<%--                    },--%>
<%--                    "dataType": "text",--%>
<%--                    "success": function (response) {--%>
<%--                        alert(response);--%>
<%--                    },--%>
<%--                    "error": function (response) {--%>
<%--                        alert(response);--%>
<%--                    }--%>
<%--                });--%>
<%--            });--%>

<%--            $("#btn1").click(function () {--%>
<%--                $.ajax({--%>
<%--                    "url": "send/array/one.html",--%>
<%--                    "type": "post",--%>
<%--                    "data": {--%>
<%--                        "array": [5, 8, 12]--%>
<%--                    },--%>
<%--                    "dataType": "text",--%>
<%--                    "success": function (response) {--%>
<%--                        alert(response);--%>
<%--                    },--%>
<%--                    "error": function (response) {--%>
<%--                        alert(response);--%>
<%--                    }--%>
<%--                });--%>
//             });
            $("#btn5").click(function (){
                layer.msg("Layer的弹框");
            });
        });

    </script>
</head>
<body>
<a href="test/ssm.html">测试ssm整合环境</a>
<%--<br/>--%>
<%--<br/>--%>
<%--<button id="btn1">Send [5,8,12] one</button>--%>
<%--<br/>--%>
<%--<br/>--%>
<%--<button id="btn2">Send [5,8,12] two</button>--%>
<br/>
<br/>
<button id="btn3">Send [5,8,12] three</button>
<br/>
<br/>
<button id="btn5">点我弹框</button>
</body>
</html>
